Chris Pollett > Old Classses >
CS174

( Print View )

Student Corner:
  [Grades Sec1]
  [Submit Sec1]
  [Class Sign Up Sec1]
  [
Lecture Notes]
  [Discussion Board]

Course Info:
  [Texts & Links]
  [Topics/Outcomes]
  [Outcomes Matrix]
  [Grading]
  [Class Protocols]
  [HW/Quiz Info]
  [Exam Info]
  [Regrades]
  [Honesty]
  [Additional Policies]
  [Announcements]

HW Assignments:
  [Hw1]  [Hw2]  [Hw3]
  [Hw4]  [Hw5]  [Quizzes]

Practice Exams:
  [Midterm]  [Final]

                           












HW#1 --- last modified February 07 2019 04:37:26..

Solution set.

Due date: Sep 9

Files to be submitted:
  Hw1.zip

Purpose:

Related Course Outcomes:

To install Apache. To experiment with the HTTP protocol. To write our first XHTML/HTML 5 validating web page.

The main course outcomes covered by this assignment are:

(1) Write HTML documents containing standard HTML elements including forms, tables, client-side scripts, and server-side scripts.

Specification:

All files that you make for Hw1 should be zipped together into the file Hw1.zip and submitted.

For the first part of the assignment, I want you to install Apache, PHP, and Mysql on your laptop and configure it so I can see each of these things is running. You may choose to install MariaDB (a non-Oracle Mysql fork) instead or Mysql. If you decide (as I suggest) to install Xampp to get stuff running, then I will test that your installation is working by going to the phpMyAdmin page. Demoing this to me either at the start of class or before I give out grades for this homework is worth 1/2 a point. In addition to installing these programs it is useful for this class to have a simple text editor which can be configured to display whitespace characters such as spaces, tabs, end-of-lines, as well as be able to indicate if the line is longer than 80 characters. The open-source editor gedit is available on Windows, Mac, and Linux and can do this. Also, for future homeworks I might get you to use git for version control, so it wouldn't hurt to try to install it early.

For the second part of this homework I want you to experiment with using HTTP. For this part of the assignment, I want you to put two files into Hw1.zip, experiment-transcript.txt and experiment-results.txt: the former has, in your own words, in English, a description of what you did, the latter has actual text-captures of your experiments. The first experiment I want you to try to do is to try to telnet from the command line into wsj.com port 80 and request robots.txt file using HTTP/1.1. If you see a 301 Moved Permanently error, I want you to pretend to be a browser and go to the url it suggests, and then request the robots.txt file. Next in your results file I want you to say: How many different User-agents were listed in the file? What the distinct kinds of lines you saw in the robots.txt file? For example, one kind of distinct command is Disallow: . For each distinct command look up and find what it does, and write one sentence about it in your results file.

Now that you have the robots.txt file I want you to request the page http://online.wsj.com/home-page also using HTTP/1.1. Again, keep a transcript. You notice that an Expire's header and Transfer-Encoding header are being sent. In your results page write a sentence saying what each of these is doing. Finally, make a request by command line for the page:

http://www.cs.sjsu.edu/faculty/pollett/icons/myphoto.jpg

You should see an Etag header in the response. Find out what this header does and write in your results a sentence about it. Make a request from the command line using an If-NONE-MATCH header to illustrate this header and save your transcript.

For the last part of the assignment I want you to write a validating HTML5 or XHTML 1.1 document, pre-raphael-elvis-painting.html. This page should describe an imagined exhibition of pre-raphaelite, Elvis paintings. Use prose that sounds like it would come from an art exhibition of such works. You should code the HTML in this page by hand. Use a simple text editor to create the page. There should be no tabs characters, indentation should be four spaces, and each line should be at most 80 characters. You will receive a zero on this part of the assignment if there is code created by an HTML Editor such as Front Page, Dreamweaver, Word, or the like. Your page should have a reasonable <head> section with a title, as well as meta tags telling robots not to index your page or follow symlinks. Your page should have table comparing the role of Elvis and King Arthur in art history. Your page should make use of an unordered list (ul and li tags) to list some famous fictitious preraphaelite, Elvis artists. pre-raphael-elvis-painting.html should constructively make use of a, img, link (to include a favicon), and span (use it for a tooltip) tags. Be careful with image sizes, as you can only upload 2Mb. Also, please use your own images or ones which can be argued are in the public domain (often Wikipedia images are public domain) rather than use copyrighted ones. Be fun and creative!

Point Breakdown

Demo of running Apache with PHP on your laptop 0.5 pt
HTTP Experiment transcripts (1/2 point off if only partial). 1 pts
HTTP Experiment robots.txt write-up (1/2pt write up of each question, 1/2 sentences for different commands). 1.5 pts
HTTP homepage and image write-up (1/2pt write-up of Expires and Transfer-Encoding, 1pt Etag, IF-NONE-MATCh). 1.5 pts
Pre-Raphaelite Elvis Page validates as HTML 5 or XHTML 1.1 and whitespace and line length as described. 0.5pt
Page constructively uses a, img, link, ul, and span tags. (1 point each) 5pts
Total10pts